package com.tc.security01.filter;

import lombok.extern.slf4j.Slf4j;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.servlet.*;
import java.io.IOException;

/**
 * @Auther: tianchao
 * @Date: 2021/11/14 14:26
 * @Description:
 */
@Component
@Order(1)
@Slf4j
public class OneFilter implements Filter, Ordered {
    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        log.info("One Filter, chain: {}", chain);
        chain.doFilter(request, response);
    }

    @Override
    public int getOrder() {
        return -101;
    }
}
